using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Transactions;

namespace Test.Support {
	class SS15Display {
		static void MainX() {
			int sum=0;
			DAL pwms=new DAL("pon-wpsq21-db06\\in06","PWMSOffsite");
			foreach(string line in File.ReadAllLines(@"C:\Users\pziarek\Desktop\oldData.txt"))
			{
				string[] cols=line.Split('\t');
				string nrefId=cols[19];
				string sku=cols[12]+cols[13];
				string part=cols[18];
				int i=(int)pwms.Scalar("select count(*)from LaunchOrder where nextreferenceId={0} and SkuCode='{1}' and part={2}",nrefId,sku,part);

				//using(TransactionScope ts=new TransactionScope())
				//{

				//  int affected=pwms.NonQry("delete from LaunchOrder where nextreferenceId={0} and SkuCode='{1}' and part={2}",nrefId,sku,part);

				//  if(affected==1)
				//    ts.Complete();
				//}


				if(i!=0)
					Console.WriteLine(sku+" "+nrefId+" "+part);

				sum+=i;
			}


			Console.WriteLine(sum);



		}
	}
}
